package com.ssm.reactive.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.web.reactive.config.PathMatchConfigurer;
import org.springframework.web.reactive.config.WebFluxConfigurer;

@Configuration(proxyBeanMethods = false)
public class WebFluxConfig implements WebFluxConfigurer {
    @Override
    public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
        configurer.defaultCodecs().enableLoggingRequestDetails(true);
    }

    @Override
    public void configurePathMatching(PathMatchConfigurer configurer) {
        // https://fangshixiang.blog.csdn.net/article/details/89810020

        // URL 忽略大小写
        configurer.setUseCaseSensitiveMatch(false);
        // 关闭后缀名匹配，关闭最后一个 / 匹配
        configurer.setUseTrailingSlashMatch(true);
    }
}
